<?php
abstract class BaseController extends Object{
	
	var $path=null;
	var $redirect=false;
	
	function setUp($path){
		$this->set("view",new View());
		$this->set("model",new Model());
		$this->view->set("path",$path);
		$this->view->model=$this->model;
		$this->view->controller=$this;
		$this->model->controller=$this;
		
	}
	function display(){
		$this->view->display();
	}
	
	function action($ob,$task){
		$class_methods = get_class_methods($ob);
		if(is_array($class_methods)){
			if(array_search($task,$class_methods)!==false)
				$ob->$task();
		}
	}
}
?>